package com.fjh.service;

import com.fjh.pojo.Course;
import com.fjh.repository.CourseRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
@Service
public class CourseService {

    @Autowired
    private CourseRepository courseRepository;

    public Course createCourse(Course course) {
        course.setCreatedTime(new Date());
        course.setStatus("0"); // 初始状态为已创建
        return courseRepository.save(course);
    }
}

